import request from "@/utils/request";

// 查询生产订单列表
export function orderList(query) {
  return request({
    url: "/mes/pro/order/list",
    method: "get",
    params: query,
  });
}

// 新增生产订单
export function addOrder(data) {
  return request({
    url: "/mes/pro/order/add",
    method: "post",
    data: data,
  });
}

// 修改生产订单
export function updateOrder(data) {
  return request({
    url: "/mes/pro/order/edit",
    method: "put",
    data: data,
  });
}

// 删除生产订单
export function deleteOrder(ids) {
  return request({
    url: "/mes/pro/order/del/" + ids,
    method: "delete",
  });
}

// 新增生产订单
export function getChangeOrder(params) {
  return request({
    url: "/mes/pro/order/listUntransformedOrNot",
    method: "get",
    params,
  });
}

// 订单作废
export function orderInvalidate(data) {
  return request({
    url: "/mes/pro/order/cancel",
    method: "post",
    data,
  });
}

// 订单复制
// export function orderCopy(ids) {
//   return request({
//     url: '/mes/pro/order/copy'+ ids,
//     method: 'put',
//   })
// }

// 订单审核、反审核
export function orderAudit(data) {
  return request({
    url: "/mes/pro/order/audit",
    method: "post",
    data: data,
  });
}

// 批量修改仓库
export function updateWarehouse(data) {
  return request({
    url: "/mes/pro/order/updateWarehouse",
    method: "put",
    data: data,
  });
}

// 批量修改物流公司
export function updateExpress(data) {
  return request({
    url: "/mes/pro/order/updateExpress",
    method: "put",
    data: data,
  });
}

// 转现货订单
export function orderToScok(data) {
  return request({
    url: "/mes/pro/order/inScok",
    method: "put",
    data: data,
  });
}

// 订单拦截
// export function orderIntercept(data) {
//   return request({
//     url: '/mes/pro/order/intercept',
//     method: 'put',
//     data: data
//   })
// }
